<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Mail.pb</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font><font color="#3A3966">;   PureBasic - Mail example file
</font><font color="#3A3966">;
</font><font color="#3A3966">;    (c) Fantaisie Software
</font><font color="#3A3966">;
</font><font color="#3A3966">; ------------------------------------------------------------
</font><font color="#3A3966">;
</font>
<font color="#3A3966">InitNetwork</font>()


<b><font color="#3A3966">If</font></b> <font color="#3A3966">CreateMail</font>(0, "fred@purebasic.com", "Hello !")

<font color="#3A3966">  SetMailBody</font>(0, "Hello !" + <font color="#924B72">#CRLF$</font> +
                 "This is a multi-" + <font color="#924B72">#CRLF$</font> +
                 "line mail !")
  
<font color="#3A3966">  AddMailAttachment</font>(0, "Geebee !"  , "Data/Geebee2.bmp")
<font color="#3A3966">  AddMailAttachment</font>(0, "World icon", "Data/world.png")
  
  <font color="#3A3966">; Change the recipients to real one
</font>  <font color="#3A3966">;
</font><font color="#3A3966">  AddMailRecipient</font>(0, "test@yourdomain.com", <font color="#924B72">#PB_Mail_To</font>)
<font color="#3A3966">  AddMailRecipient</font>(0, "test_cc@yourdomain.com", <font color="#924B72">#PB_Mail_Cc</font>)
  
  <font color="#3A3966">; Set the SMTP server to use
</font>  <font color="#3A3966">;
</font>  Result =<font color="#3A3966"> SendMail</font>(0, "smtp.free.fr", 25, <font color="#924B72">#PB_Mail_Asynchronous</font>)
  
  <b><font color="#3A3966">Repeat</font></b>
    Progress =<font color="#3A3966"> MailProgress</font>(0)
<font color="#3A3966">    Delay</font>(300)
  <b><font color="#3A3966">Until</font></b> Progress = <font color="#924B72">#PB_Mail_Finished</font> <b><font color="#3A3966">Or</font></b> Progress = <font color="#924B72">#PB_Mail_Error</font>
  
  <b><font color="#3A3966">If</font></b> Progress = <font color="#924B72">#PB_Mail_Finished</font>
<font color="#3A3966">    MessageRequester</font>("Information", "Mail correctly sent !")
  <b><font color="#3A3966">Else</font></b>
<font color="#3A3966">    MessageRequester</font>("Error", "Can't sent the mail !")
  <b><font color="#3A3966">EndIf</font></b>
  
<b><font color="#3A3966">EndIf</font></b>
</font></pre>
</body></html>
